/******************
    学生模块
 *****************/

    //民族人数
    (function(){
        var colum_minzu=echarts.init(document.getElementById("colum_minzu"));
        option_minzu={
            title : {
            text: '全校各民族学生人数',
            x:'center'
        },
            tooltip : {
                trigger: 'axis',
                axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                    type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            legend: {
                orient: 'vertical',
                left: 'right',
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '10%',
                containLabel: true
            },
            xAxis : [
                {
                    type : 'category',
                    axisLabel:{
                        interval:0,
                        rotate:40
                    },
                    data : ['汉族', '满族', '蒙古族', '回族', '壮族', 
                    '土家族', '朝鲜族','苗族','彝族','维吾尔族','布依族',
                    '侗族','白族','瑶族','藏族','哈萨克族','仡佬族','阿昌族','鄂温克族',
                    '哈尼族','黎族','傣族','畲族','傈僳族','东乡族','高山族','拉祜族','水族',
                    '佤族','纳西族','羌族','土族','仫佬族','锡伯族','柯尔克孜族','达斡尔族','景颇族',
                    '毛南族','撒拉族','布朗族','塔吉克族','阿昌族','普米族','怒族','京族',
                    '基诺族','德昂族','保安族','俄罗斯族','裕固族','乌孜别克族','门巴族','鄂伦春族',
                    '独龙族','塔塔尔族','赫哲族','珞巴族']
                }
            ],
            yAxis: {
                type: 'value',
                boundaryGap: [0, 0.01]
            },
            series : [
                {
                    name:'人数',
                    type:'bar',
                    data:[2179,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,427,395,251,206,175,136,132,117,110,78,75,59,54,36,28,23]
                }
            ]
        };
        colum_minzu.setOption(option_minzu);
    })();
    //男女比例
    (function(){
    	var pie_stu_sex=echarts.init(document.getElementById("pie_stu_sex"));
    	option_stu_sex= {
        title : {
            text: '全校学生男女比例',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        color:['#87CEFA','#EE3B3B'],
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['男','女']
        },
        series : [
            {
                name: '全校学生',
                type: 'pie',
                radius : '65%',
                center: ['50%', '50%'],
                data:[
                    {value:1115, name:'男'},
                    {value:989, name:'女'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
        };
        pie_stu_sex.setOption(option_stu_sex);
    })();
    //全校学生学历分布
    (function(){
        var pie_edu=echarts.init(document.getElementById("pie_edu"));
        option_edu = {
            title: {
                text: '全校学生学历分布',
                x:'center'
            },
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b}: {c} ({d}%)"
            },
            color:['#ff6666','#cccc33','#666699'],
            legend: {
                orient: 'vertical',
                x: 'left',
                data:['本科生','硕士生','博士生']
            },
            series: [
                {
                    name:'学历（人）',
                    type:'pie',
                    radius: ['50%', '70%'],
                    avoidLabelOverlap: false,
                    label: {
                        normal: {
                            show: false,
                            position: 'center'
                        },
                        emphasis: {
                            show: true,
                            textStyle: {
                                fontSize: '30',
                                fontWeight: 'bold'
                            }
                        }
                    },
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data:[
                        {value:335, name:'本科生'},
                        {value:310, name:'硕士生'},
                        {value:135, name:'博士生'}
                    ]
                }
            ]
        };
        pie_edu.setOption(option_edu);
    })();
    //各学院人数
    (function(){
        var colum_xy_stu=echarts.init(document.getElementById("colum_xy_stu"));
        option_xy_stu= {
            title: {
                text: '各学院学生人数'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            color:['#336699','#0099cc','#666666'],
            legend: {
                data: ['2014级','2015级','2016级']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '20%',
                containLabel: true
            },
            xAxis: {
                type: 'category',
                axisTick: {
                alignWithLabel: true
                },
                axisLabel:{
                        interval:0,
                        rotate:40
                    },

                data: ['计算机科学与工程学院','信息与通信工程学院','外国语学院','土木工程学院','国际商学院','文法学院','建筑学院','经济管理学院','信息与通信工程学院','生命科学学院','设计学院','理学院 预科教育学院','环境与资源学院','国际文化交流学院','机电工程学院']
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    name: '2014级',
                    type: 'bar',
                    data: [958,475,666,956, 1202, 855, 999, 1125, 785,785,741,846,985,458,989]
                },
                {
                    name: '2015级',
                    type: 'bar',
                    data: [ 855, 999, 1125, 785,958,956, 1202,475,985,458,989,666,785,741,846]
                },
                {
                    name: '2016级',
                    type: 'bar',
                    data: [956, 1202, 855, 999, 1125, 785,958,475,666,785,741,846,985,458,989]
                }
            ]
        };
        colum_xy_stu.setOption(option_xy_stu);
    })();
    //各学院少数民族学生分布
    (function(){
        var student_ethnic=echarts.init(document.getElementById("student_ethnic"));
        option_ethnic = {
            title:{
                text:'各学院学生民族分布' ,
                x:'center'
            },
            tooltip : {
                trigger: 'axis',
                axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                    type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            color:['#91C7AE','#C23531'],
            legend: {
                data: ['汉族', '少数民族'],
                x:'right'
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '20%',
                containLabel: true
            },
            yAxis:  {
                type: 'value'
            },
            xAxis: {
                type: 'category',
                axisLabel:{
                            interval:0,
                            rotate:40
                        },
                data: ['计算机科学与工程学院','信息与通信工程学院','外国语学院','土木工程学院','国际商学院','文法学院','建筑学院','经济管理学院','信息与通信工程学院','生命科学学院','设计学院','理学院 预科教育学院','环境与资源学院','国际文化交流学院','机电工程学院']
            },
            series: [
                {
                    name: '汉族',
                    type: 'bar',
                    stack: '总人数',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight'
                        }
                    },
                    data: [958,475,666,956, 1202, 855, 999, 1125, 785,785,741,846,985,458,989]
                },
                {
                    name: '少数民族',
                    type: 'bar',
                    stack: '总人数',
                    label: {
                        normal: {
                            show: true,
                            position: 'insideRight'
                        }
                    },
                    data: [255, 199, 125, 185,158,156, 202,175,85,158,189,166,185,141,146]
                }            
            ]
        };
        student_ethnic.setOption(option_ethnic);
    })();